# Maintainer: David Runge <dvzrv@archlinux.org>
# Contributor: Maxim Andersson <thesilentboatman@gmail.com>
# Contributor: NicoHood <archlinux {cat} nicohood {dog} de>

pkgdesc="A module with some convenient utilities not included with the standard Python install"
pkgname=python-utils
pkgver=3.8.1
pkgrel=2
arch=(any)
url="https://github.com/WoLpH/python-utils"
license=(BSD-3-Clause)
depends=(
  python
  python-typing-extensions
)
makedepends=(
  python-build
  python-installer
  python-setuptools
  python-wheel
)
checkdepends=(
  python-loguru
  python-pytest-runner
)
optdepends=('python-loguru: for logging support')
source=(
  $url/releases/download/v$pkgver/$pkgname-$pkgver.tar.gz{,.asc}
)
sha512sums=('ccba9651cc99a8f4e3f13e7ff66a43a40d2e85bc735b6246524269495ff321225a0dcad9abd03ca9cb61b4b1b35a27009fac3fe87e3f748ffc5c87a956acd335'
            'SKIP')
b2sums=('9132387de0d12c51dbd4a7a3eda561fa9935c9fa86d76346e50e4ee9401065211a02bb45e89df402900263d28b115b761c2a8d7a2fe799866da20d4848f48451'
        'SKIP')
validpgpkeys=('149325FD15904E9C4EB89E95E81444E9CE1F695D') # Rick van Hattem <wolph@wol.ph>

build() {
  cd $pkgname-$pkgver
  python -m build --wheel --no-isolation
}

check() {
  cd $pkgname-$pkgver
  pytest -vv -c /dev/null
}

package() {
  cd $pkgname-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -vDm 644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/"
  install -vDm 644 README.rst -t "$pkgdir/usr/share/doc/$pkgname/"
}
